}
else if (strcmp (element_name, "context") == 0)
{
- char *context = NULL;
+ char *id = NULL;
const char **attribute;
const char **value;
for (attribute = attribute_names, value = attribute_values; *attribute; attribute++, value++)
{
if (strcmp (*attribute, "id") == 0)
- context = g_strdup (*value);
+ {
+ id = g_strdup (*value);
+ break;
+ }
}
- if (context < 0)
+ if (!id)
{
g_set_error (error,
G_MARKUP_ERROR,
element_name);
return;
}
- data->context = context;
+ data->context = id;
}
else if (strcmp (element_name, "application") == 0)
{
for (attribute = attribute_names, value = attribute_values; *attribute; attribute++, value++)
{
if (strcmp (*attribute, "id") == 0)
- appid = g_strdup (*value);
+ {
+ appid = g_strdup (*value);
+ break;
+ }
}
if (!appid)